<template>
 <div class="box">
    <h4 style="color: #1ba9ba">今日订单状态占比</h4>
    <div id="pie">
     
    </div>
 </div>
</template>

<script>
import * as echarts from 'echarts';
import { onMounted } from 'vue';
export default {
  setup(){
    onMounted(()=>{
        var chartDom = document.getElementById('pie');
var myChart = echarts.init(chartDom);
var option;

option = {
  legend: {
    top: '5%',
    itemHeight: 8,
    itemWidth: 8,
    icon: "circle",
    left: 'center'
  },
  series: [
    {
      name: 'Access From',
      type: 'pie',
      radius: ['40%', '60%'],
      top:30,
      label: {
        show: false,
        position: 'center'
      },

      data: [
        { value: 1048, name: '已付款' },
        { value: 735, name: '代付款' },
        { value: 580, name: '已取消' },
      ],
      color:['#1BA9BA','#FF8D41','#B2B7C6']
    }
  ]
};

option && myChart.setOption(option);

    })
  }
}
</script>

<style scoped lang="scss">
.box{
  text-align: center;
  padding: 10px;
}
#pie{
    width: 400px;
    height: 200px;
}
</style>